<?php
// Copyright 2019 Hackware SpA <human@hackware.cl>
// This file is part of "Hackware Web Services Payment" and licensed under
// the terms of the GNU Affero General Public License version 3, or (at your
// option) a later version. You should have received a copy of this license
// along with the software. If not, see <https://www.gnu.org/licenses/>.

return [
    'source_url' => env('PAYMENT_SOURCE_URL'),
    'origins' => [
        'wallet' => [
            'return_url' => env('PAYMENT_RETURN_URL'),
            'notify' => [
                'status' => ['completed'],
                'uri' => env('PAYMENT_WALLET_ENDPOINT') . '/transactions',
                'headers' => [
                    'Content-Type' => 'application/json',
                    'Authorization' => 'Bearer ' . env('PAYMENT_CORE_AUTH_TOKEN'),
                ],
                'method' => 'POST',
                'params' => [
                    'user_uid' => 'payment.user_uid',
                    'currency_code' => 'payment.currency',
                    'amount' => 'payment.amount',
                    'type' => 'hawese_payment',
                    'description' => 'payment.description',
                    'detail' => [
                        'uuid' => 'payment.uuid',
                    ],
                ],
            ],
        ],
        'hacktivista_com' => [
            'return_url' => env('PAYMENT_HACKTIVISTA_COM_ENDPOINT') . '/checkout',
            'notify' => [
                'status' => ['completed', 'aborted'],
                'uri' => env('PAYMENT_HACKTIVISTA_COM_ENDPOINT') . '/verify-payment',
                'headers' => [
                    'Content-Type' => 'application/x-www-form-urlencoded',
                    'Authorization' => 'Bearer ' .
                        env('PAYMENT_HACKTIVISTA_COM_AUTH_TOKEN'),
                ],
                'method' => 'POST',
                'params' => [
                    'status' => 'payment.status',
                    'uuid' => 'payment.uuid',
                ],
            ],
        ],
    ],
];
